//Stephen Kirksharian
//Bobby H
//Due: 4/27/08

`define JAL   6'b000011
`define RTYPE 6'b000000
`define LW    6'b100011
`define LUI   6'b001111
`define LB    6'b100000

`define BEQ   6'b000100
`define BNE   6'b000101
`define J     6'b000010
`define JR    6'b001000
module RegWriteEn_ctr(opcodes,func,ctr);
	input [5:0]opcodes,func;
	output ctr;
	reg ctr;

always @(opcodes) begin
	case(opcodes)
	  `BEQ: ctr=0;
	  `BNE: ctr=0;
	  `J:   ctr=0;
          `RTYPE: begin
		if(func==`JR) ctr=0;
	  end
	  default: ctr=1;
	endcase
end
endmodule